package com.winhxd.b2c.order.dao;

import com.winhxd.b2c.common.domain.order.condition.OrderAfterSaleCompleteCondition;
import com.winhxd.b2c.common.domain.order.condition.OrderAfterSaleCondition;
import com.winhxd.b2c.common.domain.order.condition.OrderAfterSaleListCondition;
import com.winhxd.b2c.common.domain.order.condition.OrderQueryCondition;
import com.winhxd.b2c.common.domain.order.model.OrderAfterSaleDetail;
import com.winhxd.b2c.common.domain.order.vo.OrderAfterSaleDetailForRebate;
import com.winhxd.b2c.common.domain.order.vo.OrderAfterSaleDetailVO;
import com.winhxd.b2c.common.domain.order.vo.OrderInfoAfterSaleVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface OrderAfterSaleDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(OrderAfterSaleDetail record);

    int insertSelective(OrderAfterSaleDetail record);

    OrderAfterSaleDetail selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderAfterSaleDetail record);

    int updateByPrimaryKey(OrderAfterSaleDetail record);

    /**
     * @author zhanghuan
     * @date  2018年10月26日 下午2:11:57
     * @Description 查询订单售后信息
     */
    List<OrderAfterSaleDetailVO> selectOrderAfterSaleDetailByCondition(OrderAfterSaleCondition condition);

    /**
     * @Description根据订单号和SKU查询售后信息
     * @author lining
     * @date 2019/1/24 15:45:32
     * @param condition
     * @return
     */
    List<OrderAfterSaleDetailVO> selectOrderAfterSaleDetailByConditionForValidate(OrderAfterSaleCondition condition);

    /**
     * @author zhanghuan
     * @date  2018年10月26日 下午2:11:57
     * @Description 查询订单售后信息列表 带查询条件---后台
     */
    List<OrderAfterSaleDetailVO> selectOrderAfterSaleDetailListByCondition(OrderAfterSaleListCondition condition);

    /**
     *@author: zhangyanwei
     *@date: 2019/1/10 14:14
     *@Description: 更新售后状态
     *@param: [condition]
     *@return: int
     */
    int updateCompleteStatusByCondition(OrderAfterSaleCompleteCondition condition);

    /**
     *@author: zhangyanwei
     *@date: 2019/1/10 17:32
     *@Description: 根据订单号查询售后申请详细信息
     *@param: [orderNo]
     *@return: java.util.List<com.winhxd.b2c.common.domain.order.model.OrderAfterSaleDetail>
     */
    List<OrderAfterSaleDetail> selectInfoByOrderNo(String orderNo);

    /**
     * @Description 查询售后数量
     * @author lining
     * @date 2019/1/10 17:15:02
     * @param afterSaleDetail
     * @return
     */
    int getApplyCount(OrderAfterSaleDetail afterSaleDetail);

    /**
     * @Description 根据订单号查skuId
     * @author lining
     * @date 2019/1/12 11:32:16
     * @param orderNo
     * @return
     */
    List<Long> selectSkuIdByOrderNo(String orderNo);

    /**
     * @Description 根据订单编号查询售后记录（未发货退款）
     * @author lining
     * @date 2019/1/12 14:09:33
     * @param orderNo
     * @return
     */
    OrderAfterSaleDetail selectOrderAfterSaleDetailByOrderNo(@Param("orderNo") String orderNo);

    /**
     * @Description 小程序售后列表
     * @author lining
     * @date 2019/1/18 13:11:26
     * @param condition
     * @return
     */
    List<OrderInfoAfterSaleVO>selectAfterSaleInfo(OrderQueryCondition condition);

    /**
     * @Description 小程序售后列表总条数
     * @author lining
     * @date 2019/1/18 13:11:07
     * @param condition
     * @return
     */
    int countAfterSaleInfo(OrderQueryCondition condition);

    /**
     * @Description 根据订单号查询售后信息
     * @author lining
     * @date 2019/1/19 16:43:05
     * @param orderNo
     * @return
     */
    List<OrderAfterSaleDetail> selectListByOrderNo(String orderNo);

    /**
     * @Description 根据订单号查询售后信息(修改收益状态)
     * @author lining
     * @date 2019/1/19 16:43:05
     * @param orderNo
     * @return
     */
    List<OrderAfterSaleDetailForRebate> selectAfterSaleForRebateByOrderNo(String orderNo);

}